#!/bin/bash

# this is the common function for all the hook script, it shall call
# a repo specific script and return its exit status.

if [ "$1" == "" ]; then
    echo "Parameter missing..."
    exit -1000
fi

gitroot=$(git rev-parse --show-toplevel)

#
# to check the repo specific setting.
# if the repo script return none 0, the operation may fail.
scriptname=$1
if [ -f $gitroot/.git-$scriptname ]; then
    shift
    $gitroot/.git-$scriptname $@
    exit $?
fi

